[{1 :neovim/nvim-lspconfig
  :config (lambda []
            (vim.wait 1000)

            (fn get_compile_commands []
              (.. (vim.fn.getcwd) :/cmake-build-Debug/))

            (fn general_on_attach [client bufnr]
              (let [buf_set_option (fn [...]
                                     (vim.api.nvim_buf_set_option bufnr ...))]
                (buf_set_option :omnifunc "v:lua.vim.lsp.omnifunc"))
              (let [buf_set_keymap (fn [...]
                                     (vim.api.nvim_buf_set_keymap bufnr ...))
                    opts {:noremap true :silent true}]
                (buf_set_keymap :n :gD "<cmd>lua vim.lsp.buf.declaration()<CR>"
                                opts)
                (buf_set_keymap :n :gd "<cmd>lua vim.lsp.buf.definition()<CR>"
                                opts)
                (buf_set_keymap :n :K "<cmd>lua vim.lsp.buf.hover()<CR>" opts)
                (buf_set_keymap :n :gi
                                "<cmd>lua vim.lsp.buf.implementation()<CR>" opts)
                (buf_set_keymap :n :<C-k>
                                "<cmd>lua vim.lsp.buf.signature_help()<CR>" opts)
                (buf_set_keymap :n :<space>wa
                                "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>"
                                opts)
                (buf_set_keymap :n :<space>wr
                                "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>"
                                opts)
                (buf_set_keymap :n :<space>wl
                                "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>"
                                opts)
                (buf_set_keymap :n :<space>D
                                "<cmd>lua vim.lsp.buf.type_definition()<CR>"
                                opts)
                (buf_set_keymap :n :<space>rn
                                "<cmd>lua vim.lsp.buf.rename()<CR>" opts)
                (buf_set_keymap :n :<space>ca
                                "<cmd>lua vim.lsp.buf.code_action()<CR>" opts)
                (buf_set_keymap :n :gr
                                "<cmd>lua require'telescope.builtin'.lsp_references{}<CR>"
                                opts)
                (buf_set_keymap :n :ge
                                "<cmd>lua require'telescope.builtin'.diagnostics{}<CR>"
                                opts)
                (buf_set_keymap :n :<space>e
                                "<cmd>lua vim.diagnostic.open_float() <CR>" opts)
                (buf_set_keymap :n "[d"
                                "<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>"
                                opts)
                (buf_set_keymap :n "]d"
                                "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>"
                                opts)
                (buf_set_keymap :n :<space>q
                                "<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>"
                                opts)
                (buf_set_keymap :n :<space>f
                                "<cmd>lua vim.lsp.buf.formatting()<CR>" opts)
                (buf_set_keymap :n :<m-p>
                                "<cmd>lua require('telescope.builtin').lsp_document_symbols()<cr>"
                                opts)
                (buf_set_keymap :n :<m-o> :<cmd>ClangdSwitchSourceHeader<CR>
                                opts)))

            ((. (. (require :lspconfig) :clangd) :setup) {:filetypes [:c :cpp]
                                                          :on_attach (lambda [client
                                                                              bufnr]
                                                                       (general_on_attach client
                                                                                          bufnr))
                                                          :cmd [:clangd
                                                                :--background-index
                                                                (.. :--compile-commands-dir=
                                                                    (get_compile_commands))]
                                                          ; :capabilities ((. (. (require :cmp_nvim_lsp))
                                                          ;                   :default_capabilities) (vim.lsp.protocol.make_client_capabilities))
                                                          :flags {:debounce_text_changes 150}
                                                          :initializationOptions {:clangdFileStatus true}})
            ((. (. (require :lspconfig) :vtsls) :setup) {:on_attach (lambda [client
                                                                             bufnr]
                                                                      (general_on_attach client
                                                                                         bufnr))
                                                         :settings {:vtsls {:javascript {:format {:enable true}}
                                                                            :typescript {:format {:enable true
                                                                                                  :convertTabsToSpaces true
                                                                                                  :baseIndentSize 4
                                                                                                  :tabSize 4
                                                                                                  :indentSize 4
                                                                                                  :insertSpaceAfterCommaDelimiter true
                                                                                                  :insertSpaceAfterConstructor false
                                                                                                  :insertSpaceBeforeFunctionParenthesis false
                                                                                                  :semicolons :remove}}}}})
            ((. (. (require :lspconfig) :fennel_ls) :setup) {:root_dir (fn []
                                                                         (vim.fn.getcwd))
                                                             :on_attach (lambda [client
                                                                                 bufnr]
                                                                          (general_on_attach client
                                                                                             bufnr))})
            ((. (. (require :lspconfig) :rust_analyzer) :setup) {:on_attach (lambda [client
                                                                                     bufnr]
                                                                              (general_on_attach client
                                                                                                 bufnr))}
                                                                ; :capabilities
                                                                ; ((. (. (require :cmp_nvim_lsp))
                                                                ;     :default_capabilities) (vim.lsp.protocol.make_client_capabilities))
                                                                ))}
 {1 :williamboman/mason.nvim
  :config (lambda []
            ((. (require :mason) :setup) {}))}
 {1 :Olical/nfnl
  :config (lambda []
            ((. (require :nfnl) :setup)))}
 {1 :olimorris/onedarkpro.nvim
  :config (lambda []
            ((. (require :onedarkpro) :setup) {:options {:transparency false}}))}
 {1 :onsails/lspkind-nvim
  :config (lambda []
            ((. (require :lspkind) :init) {:mode :symbol_text
                                           :symbol_map {:Copilot ""}})
            (vim.api.nvim_set_hl 0 :CmpItemKindCopilot {:fg "#6CC644"}))}
 [:hrsh7th/vim-vsnip]
 [:nvim-lua/plenary.nvim]
 {1 :L3MON4D3/LuaSnip}
 {1 :nvim-telescope/telescope.nvim
  :config (lambda []
            ((. (require :telescope) :setup) {}))}
 {1 :stevearc/aerial.nvim
  :config (lambda []
            ((. (require :aerial) :setup) {:backends [:lsp]
                                           :disable_max_lines 200000}))}
 {1 :akinsho/toggleterm.nvim
  :config (lambda []
            ((. (require :toggleterm) :setup) {:open_mapping "<c-\\>"
                                               :start_in_insert false})
            (local powershell-options
                   {:shell (or (and (= (vim.fn.executable :pwsh) 1) :pwsh)
                               :powershell)
                    :shellcmdflag "-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;"
                    :shellpipe "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode"
                    :shellquote ""
                    :shellredir "-RedirectStandardOutput %s -NoNewWindow -Wait"
                    :shellxquote ""})
            (if (= (. (vim.loop.os_uname) :sysname) :Windows)
                (each [option value (pairs powershell-options)]
                  (tset vim.opt option value))))}
 {1 :ggandor/leap.nvim
  :config (lambda []
            ((. (require :leap) :setup) {})
            ((. (require :leap) :create_default_mappings)))}
 {1 :lukas-reineke/lsp-format.nvim
  :config (lambda []
            ((. (require :lsp-format) :setup)))}
 {1 :kyazdani42/nvim-tree.lua
  :config (lambda []
            ((. (require :nvim-tree) :setup) {})
            (set vim.g.loaded_netrw 1))
  :requires {1 :kyazdani42/nvim-web-devicons}}
 {1 :RRethy/vim-illuminate
  :config (lambda []
            ((. (require :illuminate) :configure) {:providers {1 :lsp}
                                                   :delay 100}))}
 {1 :ilyachur/cmake4vim}
 {1 :nvim-lualine/lualine.nvim
  :config (lambda []
            ((. (require :lualine) :setup) {:extensions {}
                                            :inactive_sections {:lualine_a {}
                                                                :lualine_b {}
                                                                :lualine_c [:filename]
                                                                :lualine_x [:location]
                                                                :lualine_y {}
                                                                :lualine_z {}}
                                            :options {:always_divide_middle true
                                                      :component_separators {:left ""
                                                                             :right ""}
                                                      :disabled_filetypes {}
                                                      :icons_enabled true
                                                      :section_separators {:left ""
                                                                           :right ""}}
                                            :sections {:lualine_a [:mode]
                                                       :lualine_b [:branch
                                                                   :diff
                                                                   {1 :diagnostics
                                                                    :sources [:nvim_diagnostic]
                                                                    :symbols {:error " "
                                                                              :hint " "
                                                                              :info " "
                                                                              :warn " "}}]
                                                       :lualine_c [:filename
                                                                   :location]
                                                       :lualine_x [(require :minuet.lualine)
                                                                   :encoding
                                                                   :fileformat
                                                                   :filetype]
                                                       :lualine_y [:progress]
                                                       :lualine_z [:location]}
                                            :tabline {}}))}
 {1 :stevearc/conform.nvim
  :config (lambda []
            (tset (. (require :conform) :formatters) :prettier
                  {:options {:ext_parsers {}
                             :ft_parsers {:typescriptreact :typescript}}})
            ((. (require :conform) :format) {:async true :lsp_fallback 500})
            ((. (require :conform) :setup) {:formatters_by_ft {:fennel [:fnlfmt]
                                                               :typescriptreact [:prettier]
                                                               :typescript [:prettier]
                                                               :json [:jq]}
                                            :format_on_save {:async false
                                                             :timeout_ms 5000
                                                             :lsp_fallback true}}))}
 [:numToStr/Comment.nvim]
 [:pasky/claude.vim]
 {1 :folke/trouble.nvim
  :cmd :Trouble
  :keys [{1 :<leader>xx
          2 "<cmd>Trouble diagnostics toggle<cr>"
          :desc "Diagnostics (Trouble)"}
         {1 :<leader>xX
          2 "<cmd>Trouble diagnostics toggle filter.buf=0<cr>"
          :desc "Buffer Diagnostics (Trouble)"}
         {1 :<leader>cs
          2 "<cmd>Trouble symbols toggle focus=false<cr>"
          :desc "Symbols (Trouble)"}
         {1 :<leader>cl
          2 "<cmd>Trouble lsp toggle focus=false win.position=right<cr>"
          :desc "LSP Definitions / references / ... (Trouble)"}
         {1 :<leader>xL
          2 "<cmd>Trouble loclist toggle<cr>"
          :desc "Location List (Trouble)"}
         {1 :<leader>xQ
          2 "<cmd>Trouble qflist toggle<cr>"
          :desc "Quickfix List (Trouble)"}]
  :opts {}}
 {1 :nvim-treesitter/nvim-treesitter
  :config (lambda []
            ((. (require :nvim-treesitter.configs) :setup) {:highlight {:enable true}}))}
 {1 :olimorris/codecompanion.nvim
  :config (lambda []
            (let [codecompanion-config (require :plugins.codecompanion_config)]
              ((. (require :codecompanion) :setup) codecompanion-config.config)))
  :dependencies [{1 :nvim-lua/plenary.nvim :branch :master}
                 :nvim-treesitter/nvim-treesitter
                 :ravitemer/codecompanion-history.nvim
                 :echasnovski/mini.diff]}
 {1 :numToStr/Comment.nvim
  :config (lambda []
            ((. (require :Comment) :setup)))}
 {1 :Bekaboo/dropbar.nvim
  :config (fn []
            ((. (require :dropbar) :setup) {:bar {:sources [(. (require :dropbar.sources)
                                                               :path)
                                                            (. (require :dropbar.sources)
                                                               :lsp)]}})
            (local dropbar-api (require :dropbar.api))
            (vim.keymap.set :n "<Leader>;" dropbar-api.pick
                            {:desc "Pick symbols in winbar"})
            (vim.keymap.set :n "[;" dropbar-api.goto_context_start
                            {:desc "Go to start of current context"})
            (vim.keymap.set :n "];" dropbar-api.select_next_context
                            {:desc "Select next context"}))
  :dependencies {1 :nvim-telescope/telescope-fzf-native.nvim :build :make}}
 {1 :nwiizo/cargo.nvim
  :build "cargo build --release"
  :cmd [:CargoBench
        :CargoBuild
        :CargoClean
        :CargoDoc
        :CargoNew
        :CargoRun
        :CargoTest
        :CargoUpdate]
  :config (fn []
            ((. (require :cargo) :setup) {:auto_close false
                                          :border :rounded
                                          :close_timeout 5000
                                          :float_window true
                                          :window_height 0.8
                                          :window_width 0.8}))
  :ft [:rust]}
 [:ellisonleao/gruvbox.nvim]
 {1 :NeogitOrg/neogit
  :dependencies [:nvim-lua/plenary.nvim
                 :sindrets/diffview.nvim
                 :nvim-telescope/telescope.nvim
                 :ibhagwan/fzf-lua
                 :echasnovski/mini.pick
                 :folke/snacks.nvim]}
 {1 :milanglacier/minuet-ai.nvim
  :config (fn []
            (let [minuet_adapter (require :plugins.minuet_adapter)]
              ((. (require :minuet) :setup) {:provider :openai_fim_compatible
                                             :request_timeout 30
                                             :provider_options {:openai_fim_compatible minuet_adapter.qwen-coder}})))}
 {1 :saghen/blink.cmp
  :dependencies [:rafamadriz/friendly-snippets]
  :config (fn []
            ((. (require :blink-cmp) :setup) {:appearance {:nerd_font_variant :mono}
                                              :completion {:documentation {:auto_show false}
                                                           :trigger {:prefetch_on_insert false}
                                                           :list {:selection {:preselect false
                                                                              :auto_insert true}}}
                                              :fuzzy {:implementation :prefer_rust_with_warning}
                                              :keymap {:<A-y> ((. (require :minuet)
                                                                  :make_blink_map))
                                                       :<C-b> [:scroll_documentation_up
                                                               :fallback]
                                                       :<C-e> [:hide]
                                                       :<C-f> [:scroll_documentation_down
                                                               :fallback]
                                                       :<C-k> [:show_signature
                                                               :hide_signature
                                                               :fallback]
                                                       :<Tab> [:select_next
                                                               :fallback_to_mappings]
                                                       :<S-Tab> [:select_prev
                                                                 :fallback_to_mappings]
                                                       :<C-space> [:show
                                                                   :show_documentation
                                                                   :hide_documentation]
                                                       :<C-y> [:select_and_accept]
                                                       :<Down> [:select_next
                                                                :fallback]
                                                       :<C-p> [:snippet_backward
                                                               :fallback]
                                                       :<C-n> [:snippet_forward
                                                               :fallback]
                                                       :<Up> [:select_prev
                                                              :fallback]}
                                              :sources {:providers {:minuet {:async true
                                                                             :module :minuet.blink
                                                                             :name :minuet
                                                                             :score_offset 50
                                                                             :timeout_ms 30000}}
                                                        :default [:lsp
                                                                  :path
                                                                  :snippets
                                                                  :buffer
                                                                  :minuet]
                                                        :per-filetype {:codecompanion [:codecompanion]}}}))
  :opts_extend [:sources.default]
  :version :1.*}
 {1 :Davidyz/VectorCode
  :dependencies [:nvim-lua/plenary.nvim]
  :config (fn []
            ((. (require :vectorcode) :setup) {:async_backend :default
                                               :async_opts {:debounce 10
                                                            :events [:BufWritePost
                                                                     :InsertEnter
                                                                     :BufReadPost]
                                                            :exclude_this true
                                                            :n_query 1
                                                            :notify false
                                                            :query_cb ((. (require :vectorcode.utils)
                                                                          :make_surrounding_lines_cb) (- 1))
                                                            :run_on_register false}
                                               :cli_cmds {:vectorcode :vectorcode}
                                               :exclude_this true
                                               :n_query 1
                                               :notify true
                                               :on_setup {:lsp false
                                                          :update false}
                                               :sync_log_env_var false
                                               :timeout_ms 5000}))}
 {1 :j-hui/fidget.nvim
  :config (fn []
            ((. (require :fidget) :setup)))}
 {1 :MeanderingProgrammer/render-markdown.nvim :ft [:markdown :codecompanion]}]
